<?php


namespace app\model\config;


use think\Model;

class CancelReasonModel extends Model
{
    protected $name = 'cancel_reason';
    protected $autoWriteTimestamp = true;

    protected $append = ['type_txt'];

    protected $typeArr = [
        1 => '教练拒单',
        2 => '教练放置大厅',
        3 => '平台放置大厅',
        4 => '平台取消',
        5 => '学员取消',
    ];

    public function getTypeTxtAttr($value, $data)
    {
        if (!isset($data['type'])) {
            return '';
        }
        return $this->typeArr[$data['type']] ?? '';
    }
}